package com.yc.springboot.demos.web;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class DemoController {

    @Value("张三")
    String name;

    @Value("${demo.name}")
    String demoName;

    @RequestMapping("name")
     String myName() {
        return name + " " + demoName;
    }

    @Autowired
    DemoProperties demoProperties;

    @RequestMapping("props")
    DemoProperties props() {
        return demoProperties;
    }
}
